<?php

/**
 * Description of CategoryController
 * 
 * @author trongkhoi
 * @since Jul 30, 2013 - 3:21:32 PM
 */
class CategoryController extends CrudController
{
    public $modelName = 'Category';
    public $title = 'Category';
    
    public function init()
    {
        parent::init();
        $this->indexColumns = array(
//            array(
//                'class' => 'CCheckBoxColumn',
//                'id' => 'ids',
//                'selectableRows' => 2,
//            ),
            array(
                'header' => Yii::t('user', 'Name'),
                'name' => 'name',
                'type' => 'raw',
                'value' => 'CHtml::link($data->name,$data->editUrl,array("target"=>"blank"))',
//                'filter' => CHtml::textField('name', getQuery('name', ''), array('placeHolder' => Yii::t('user', 'Search'))),
            ),
            array(
                'header' => Yii::t('user', 'Status'),
                'name' => 'status',
                'type' => 'raw',
                'value' => '$data->statusLabel',
                'filter' => false,
                'htmlOptions' => array(
                ),
            ),
            array('class' => 'application.widgets.MyButtonColumn',
                'editUrl' => '$data->editUrl',
                'deleteUrl' => '#',
                'htmlOptions' => array(
                    'width' => '1%'
                )
            ),
        );

        $this->formColumns = array(
            'name' => array(
                'type' => 'createUrl',
                'for' => 'url'
            ),
            'url',
//            'category' => array(
//                'type' => 'dropDownList',
//                'data' => Category::getPublicArray(),
//            ),
//            'status' => array(
//                'type' => 'radioButtonList',
//                'data' => MyActiveRecord::getArrayStatus(),
//            ),
//            'info_technical' => array(
//                'type' => 'textArea',
//            ),
//            'summary' => array(
//                'type' => 'textArea',
//            ),
//            'description' => array(
//                'type' => 'ckeditor',
//            ),
        );
    }

}

/**
 * End of CategoryController
 */